<%@ page language="java"  pageEncoding="UTF-8"%>
<%@page import="com.fick.hibernate.dao.RoleDAO"%>
<%@page import="java.util.List"%>
<%@page import="com.fick.hibernate.model.Role"%>
<%@page import="com.fick.hibernate.model.Admin"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>角色管理</title>
<style type="text/css">
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.STYLE1 {font-size: 12px;}
.STYLE4 {
	font-size: 12px;
	color: #1F4A65;
	font-weight: bold;
}

a:link {
	font-size: 12px;
	color: #06482a;
	text-decoration: none;

}
a:visited {
	font-size: 12px;
	color: #06482a;
	text-decoration: none;
}
a:hover {
	font-size: 12px;
	color: #FF0000;
	text-decoration: underline;
}
a:active {
	font-size: 12px;
	color: #FF0000;
	text-decoration: none;
}
.STYLE7 {font-size: 12px;}

</style>
<script type="text/javascript" src="js/check.js"></script>
<script type="text/javascript">
function checkForm(){
	if(trim(roleForm.roleName.value)==""){
		alert("请输入角色名称!");
		roleForm.roleName.focus();
		return false;
	}
	if(roleForm.roleOrder.value!=null && roleForm.roleOrder.value!="0" && !isInt(roleForm.roleOrder.value,"false")){
		alert("请输入正确的角色顺序!");
		roleForm.roleOrder.focus();
		return false;
	}
	return roleForm.submit();
}
</script>
</head>

<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="15" height="30"><img src="images/tab_03.gif" width="15" height="30" /></td>
        <td width="1101" background="images/tab_05.gif"><img src="images/311.gif" width="16" height="16" />
			<span class="STYLE4">角色修改页面</span></td>
        <td width="281" background="images/tab_05.gif">
        &nbsp;
        </td>
        <td width="14"><img src="images/tab_07.gif" width="14" height="30" /></td>
      </tr>
    </table>
    </td>
  </tr>
  <tr>
    <td>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="9" background="images/tab_12.gif">&nbsp;</td>
        <td bgcolor="#f3ffe3">
        <form action="role.do"  name="roleForm" method="post">
      <table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#D7DFE1">
        <tr>
        <td width="10%" height="25" background="images/tab_14.gif" class="STYLE1"><div align="center" class="STYLE2 STYLE1">编号</div></td>
        <td width="54%" height="25" background="images/tab_14.gif" class="STYLE1"><div align="center" class="STYLE2 STYLE1">角色名</div></td>
        <td width="8%" height="25" background="images/tab_14.gif" class="STYLE1"><div align="center" class="STYLE2 STYLE1">排序</div></td>
        <td width="12%" height="25" background="images/tab_14.gif" class="STYLE1"><div align="center" class="STYLE2 STYLE1">操作</div></td>
        </tr>
		<%
       				String id=request.getParameter("id");
       				if(id!=null && id.trim().length()>0){
       			Role role=new RoleDAO().findById(Integer.parseInt(id));
       		%>
	    
		<tr>
          <td width="10%" height="25" align="center" valign="middle" bgcolor="#FFFFFF">
		<input type="hidden" name="method" value="update">
		<input type="hidden" name="id" value="<%=id %>">
		 </td>
          <td width="54%" height="25" align="center" valign="middle" bgcolor="#FFFFFF" style="padding-left:7px" class="STYLE1">
		 <input type="text" name="roleName" value="<%=role.getRoleName() %>"></td>
          <td width="8%" height="25" align="center" valign="middle" bgcolor="#FFFFFF" class="STYLE1">
          <input type="text" name="roleOrder" value="<%=role.getRoleOrder() %>"></td>
          <td width="12%" height="25" align="center" valign="middle" bgcolor="#FFFFFF" class="STYLE1">
		  <input type="button" onclick="checkForm()" value="更新"></td>
		  
        </tr>
		  <%} %>	   
      </table>
      </form>
        </td>
        <td width="9" background="images/tab_16.gif">&nbsp;</td>
      </tr>
    </table>
    </td>
  </tr>
  <tr>
    <td height="29">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="15" height="29"><img src="images/tab_20.gif" width="15" height="29" /></td>
        <td background="images/tab_21.gif">
        &nbsp;</td>
        <td width="14"><img src="images/tab_22.gif" width="14" height="29" /></td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>
